package com.yilin.tms.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yilin.tms.core.application.PageData;

import com.yilin.tms.core.entity.system.applets.H5Applets;
import com.yilin.tms.system.mapper.H5AppletsMapper;
import com.yilin.tms.system.service.IH5AppletsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class H5AppletsService extends ServiceImpl<H5AppletsMapper, H5Applets> implements IH5AppletsService {
    @Autowired
    private H5AppletsMapper h5AppletsMapper;
    @Override
    public PageData<H5Applets> getAppletsPage(H5Applets query, Integer page, Integer limit) {
        return h5AppletsMapper.getAppletsPage(new PageData<>(page,limit),query);
    }
    @Override
    public void saveOrUpdates(H5Applets h5Applets) {
        saveOrUpdate(h5Applets);
    }

    @Override
    public H5Applets getAppletsByAppId(String appletsId) {
        QueryWrapper<H5Applets> wrapper = new QueryWrapper<>();
        wrapper.eq("app_id",appletsId);
        return  h5AppletsMapper.selectOne(wrapper);
    }
    @Override
    public H5Applets getAppletsById(String appletsId) {
        return  h5AppletsMapper.selectById(appletsId);
    }
    @Override
    public void deleteApplets(String appletsId) {
        h5AppletsMapper.deleteById(appletsId);
    }

}
